package com.wjk.kylin.mall.gateway.util;

import com.alibaba.ttl.TransmittableThreadLocal;

public class SysContext {
    /**
     * 支持父子线程
     */
    private static final ThreadLocal<String> THREAD_LOCAL = new TransmittableThreadLocal<>();

    public static String getTraceId() {
        return THREAD_LOCAL.get();
    }

    public static void setTraceId(String traceId) {
        THREAD_LOCAL.set(traceId);
    }

    public static void removeTraceId() {
        THREAD_LOCAL.remove();
    }

}
